#ifndef _MODULE_PITCHYAWMOTOR_H_
#define _MODULE_PITCHYAWMOTOR_H_

#ifdef __cplusplus
 extern "C" {
#endif
#include "includes.h"
#include "Tool_PID.h"
	 
#ifdef   _MODULE_PITCHYAWMOTOR_GLOBALS
#define  _MODULE_PITCHYAWMOTOR_EXT        
#else 
#define _MODULE_PITCHYAWMOTOR_EXT   extern
#endif

typedef struct MotorEncoder_Struct
{
	float PitchEncoder;
	float YawEncoder;
}MotorEncoderStruct;

_MODULE_PITCHYAWMOTOR_EXT u8 YawChangeFlag;
_MODULE_PITCHYAWMOTOR_EXT FUZZYPID PitchPID,YawPID;

MotorEncoderStruct GetMotorEncoder(void);

void PitchYawMotor_Config(void);
void PitchMotor_Pack_Handle(CanRxMsg *msg_rece);
void YawMotor_Pack_Handle(CanRxMsg *msg_rece);	
void PitchYaw_PIDControl(void);
void Motor_YawPitch(int16_t current_205,int16_t current_206);


extern float Pitch_Constrain;
extern float Yaw_Constrain;
extern float Max_Pitch,Min_Pitch; 
extern s8 Pitch_dir,Yaw_dir;
extern float Pitch_num,Yaw_num;

extern u8 Move_dir;
extern float Move_Num;
extern float Encoder_Max;
extern float Encoder_Min;
extern PN_PID PN_PitchPID;
extern u8 Auto_flag;
#ifdef __cplusplus
 }
#endif
 
#endif
